home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************
- '* Ingredient file type *
- '****************************************************************
-
- Type IngredientType
- IngKey As String * 15
- 'IngSupplierNo AS STRING * 3
- 'IngNo AS STRING * 12
- IngGroup As String * 4
- IngDesc As String * 30
- IngSizeDesc As String * 10
- IngFormat As String * 3
- IngCaseCost As Long
- IngPacksPerCase As Long
- IngPackDesc As String * 10
- IngUnitsPerCase As Long
- IngUnitDesc As String * 10
- End Type
-
- Global IngredientRec As IngredientType
- Global IngredientSaveRec As IngredientType
- Global IngredientSt%
- Global IngredientKeyB$
- Global IngredientPosBlk As PosBlk
-
- Sub CloseIngredientFile ()
- '********** Close Ingredient file **********************
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BCLOSE, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub DeleteIngredient ()
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BDELETE, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub FirstIngredient ()
- If Len(IngredientKeyB$) <> 15 Then
- IngredientKeyB$ = String$(15, " ")
- End If
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BFIRST, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub FirstIngredientKey1 ()
- If Len(IngredientKeyB$) <> 19 Then
- IngredientKeyB$ = String$(19, " ")
- End If
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 1
- IngredientSt% = 0
- IngredientSt% = btrcall(BFIRST, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub GetGEIngredient ()
- IngredientKeyB$ = IngredientRec.IngKey
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BGETGE, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub MsgIngredientNotFound ()
- Msg$ = "Ingredient not found. Status = " + Str$(IngredientSt%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End Sub
-
- Sub MsgIngredientNotOpen ()
- Msg$ = "Ingredient file not opened."
- T1% = MsgBox(Msg$, 0, "Warning!")
- End Sub
-
- Sub MsgUnknownIngredientError ()
- Msg$ = "Ingredient file error. Status = " + Str$(IngredientSt%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End Sub
-
- Sub NextIngredient ()
- If Len(IngredientKeyB$) <> 15 Then
- IngredientKeyB$ = String$(15, " ")
- End If
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BNEXT, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub NextIngredientKey1 ()
- If Len(IngredientKeyB$) <> 19 Then
- IngredientKeyB$ = String$(19, " ")
- End If
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 1
- IngredientSt% = 0
- IngredientSt% = btrcall(BNEXT, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- '
- '
- Sub OpenIngredientFile ()
-
- '******** Open Ingredient File ********************
- IngredientKeyB$ = "ingdfile.btr"
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BOPEN, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- If IngredientSt% <> 0 Then
- Msg$ = "Ingredient file open failed. Status = " + Str$(IngredientSt%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End If
- End Sub
-
- Sub PreviousIngredient ()
- If Len(IngredientKeyB$) <> 15 Then
- IngredientKeyB$ = String$(15, " ")
- End If
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BPREVIOUS, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub ReadIngredient ()
- IngredientKeyB$ = IngredientRec.IngKey
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BEQUAL, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub UpdateIngredient ()
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BUPDATE, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
- Sub WriteIngredient ()
- IngredientKeyBufLen% = 255
- IngredientBufLen% = Len(IngredientRec)
- KeyNum% = 0
- IngredientSt% = 0
- IngredientSt% = btrcall(BINSERT, IngredientPosBlk, IngredientRec, IngredientBufLen%, IngredientKeyB$, IngredientKeyBufLen%, KeyNum%)
- End Sub
-
-